package com.ceit.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.servlet.ModelAndView;

/**
 * Created by 隼 on 2017/6/6.
 */

@Controller
public class SpringMvcController {

    @RequestMapping(value="/welcome",method= RequestMethod.GET)
    public ModelAndView getFirstPage() {
        //welcom就是视图的名称（welcome.ftl）
        ModelAndView mv = new ModelAndView();
        mv.setViewName("welcome");
        mv.addObject("name", "this is freemaker test!!!");
        return mv;
    }
}

